<template>
	<view class="content">
		<mycart @del="del"  v-for="item in artlist" :key="item.id" :item="item"></mycart>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				artlist:[],
			}
		},
		methods: {
			del(id){
				console.log(id, '子传父的id');
				// 把不删的留下来
				this.artlist = this.artlist.filter(item => item.id != id)
			}
		},
		onLoad() {
			// 请求数据
			uni.request({
				url:"https://api.it120.cc/small4/cms/news/list",
				success:(res)=>{
					console.log(res);
					this.artlist = res.data.data;
				}
			})
		}
	}
</script>

<style lang="scss">
.content{
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
}
</style>
